<template>
  <div class="hello">
    登录<br />
    <input type="button" value="登录" @click="fn" />
  </div>
</template>

<script>
export default {
  name: 'Home',
  props: {
    msg: String
  },
  methods: {
    fn() {
      sessionStorage.setItem(
        'USER_LOGIN',
        JSON.stringify({ name: 'tom', age: '20' })
      )
      this.$router.push('/login')
    }
  },
  beforeRouteEnter() {}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less"></style>
